import { Thinkingdata } from "./Thinkingdata";

export async function 点数不够(server:string){
    //Editor.panelManager.showPanel('AIPopupPanel');    
    Thinkingdata.ins.track("need_recharge_point", {});
    if(confirm('您的点数不足，是否通过兑换码充值？')){
        Thinkingdata.ins.track("recharge_point_start", {});
        //@ts-ignore
        let ret = await IEditor.AssetStoreTools.exchange("10151");
        Thinkingdata.ins.track("recharge_point_end", {ret});
        return ret;
    }
    return false;
}

export async function 服务过期(servers:string){
    //Editor.panelManager.showPanel('AIPopupPanel');    
    Thinkingdata.ins.track("need_subscribe", {});
    if(confirm('服务过期，是否充值')){
        Thinkingdata.ins.track("subscribe_start", {});
        let ret = await IEditor.AssetStoreTools.subscribe("10151"); 
        Thinkingdata.ins.track("subscribe_end", {ret});
        return ret;
    }
    return false;
}

export async function recharge(){
    return true;
}